<?php
namespace Shared\Multimedia;

use Doctrine\ORM\Mapping as ORM;

/**
 * Description of File
 *
 * @author nofear
 */

/**
 * @ORM\Entity
 * @ORM\Table(name="mm_files")
 * @ORM\InheritanceType("JOINED")
 * @ORM\DiscriminatorColumn(name="typeId", type="integer")
 * @ORM\DiscriminatorMap({
 *          "1" = "Image",
 *          "2" = "Document"
 *      })
 */
class File {
    
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     */
    protected $id;
    
    /**
     * @ORM\Column
     */
    protected $name;
    
    /**
     * @ORM\Column(name="`md5`")
     */
    protected $md5;
    
    /**
     * @ORM\Column
     */
    protected $ext;
    
    /**
     * @ORM\OneToOne(targetEntity="Shared\Multimedia\SiteObjectGalleryItem", mappedBy="File")
     */
    protected $SiteObjectGalleryItem;
    
    public function getId() {
        return $this->id;
    }

    public function getName() {
        return $this->name;
    }

    public function getMd5() {
        return $this->md5;
    }

    public function getExt() {
        return $this->ext;
    }

    public function setId($id) {
        $this->id = $id;
    }

    public function setName($name) {
        $this->name = $name;
    }

    public function setMd5($md5) {
        $this->md5 = $md5;
    }

    public function setExt($ext) {
        $this->ext = $ext;
    }
    
    public function getSiteObjectGalleryItem($Object = null) {
        return $this->SiteObjectGalleryItem;
    }

    public function setSiteObjectGalleryItem($SiteObjectGalleryItem) {
        $this->SiteObjectGalleryItem = $SiteObjectGalleryItem;
    }
}
